﻿using Elektronix.Class;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Elektronix
{
    public partial class chart : System.Web.UI.Page
    {
    
        
        
        
        
        
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["userID"] != null)
            {
                siparisler s= new siparisler();
                string kuki = "sepet" + Session["userID"].ToString();
                if (Request.Cookies[kuki] != null)
                {
                    if (Request.QueryString["scid"] != null)
                    {
                        s.sepet = Request.Cookies[kuki].Value.ToString();
                        s.userID = Session["userID"].ToString();
                        s.sepetduzenle(Request.QueryString["scid"].ToString());
                        Response.Cookies[kuki].Expires = DateTime.Now.AddMinutes(-1);
                        Response.Cookies.Add(s.sepeteekle());
                        Response.Redirect("chart.aspx");
                    }
                    else
                    {
                        s.sepet = Request.Cookies[kuki].Value.ToString();
                        Repeater1.DataSource = s.sepetiyazdir();
                        Repeater1.DataBind();
                        // s.sepetiyazdır metodundan donen list benim siparis listem
                    }
                }
            }
            else
            {
                Response.Redirect("login.aspx");
            }
        }






        protected void Button1_Click(object sender, EventArgs e)
        {
            Response.Redirect("order.aspx");
        }







    }
}